# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AdSensePlatform.V1alpha.Model.Account do
  @moduledoc """
  Representation of an Account.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Creation time of the account.
  *   `creationRequestId` (*type:* `String.t`, *default:* `nil`) - Required. An opaque token that uniquely identifies the account among all the platform's accounts. This string may contain at most 64 non-whitespace ASCII characters, but otherwise has no predefined structure. However, it is expected to be a platform-specific identifier for the user creating the account, so that only a single account can be created for any given user. This field must not contain any information that is recognizable as personally identifiable information. e.g. it should not be an email address or login name. Once an account has been created, a second attempt to create an account using the same creation_request_id will result in an ALREADY_EXISTS error.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Display name of this account.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the account. Format: platforms/pub-[0-9]+/accounts/pub-[0-9]+
  *   `regionCode` (*type:* `String.t`, *default:* `nil`) - Required. Input only. CLDR region code of the country/region of the address. Set this to country code of the child account if known, otherwise to your own country code.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. Approval state of the account.
  *   `timeZone` (*type:* `GoogleApi.AdSensePlatform.V1alpha.Model.TimeZone.t`, *default:* `nil`) - Required. The IANA TZ timezone code of this account. For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. This field is used for reporting. It is recommended to set it to the same value for all child accounts.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :creationRequestId => String.t() | nil,
          :displayName => String.t() | nil,
          :name => String.t() | nil,
          :regionCode => String.t() | nil,
          :state => String.t() | nil,
          :timeZone => GoogleApi.AdSensePlatform.V1alpha.Model.TimeZone.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:creationRequestId)
  field(:displayName)
  field(:name)
  field(:regionCode)
  field(:state)
  field(:timeZone, as: GoogleApi.AdSensePlatform.V1alpha.Model.TimeZone)
end

defimpl Poison.Decoder, for: GoogleApi.AdSensePlatform.V1alpha.Model.Account do
  def decode(value, options) do
    GoogleApi.AdSensePlatform.V1alpha.Model.Account.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AdSensePlatform.V1alpha.Model.Account do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
